﻿using System;
using System.Collections.Generic;
using System.Text;
using EasyToHelp.Entity;

namespace EasyToHelp.Business
{
    public static class ResultInfo
    {
        /// <summary>
        /// 操作成功提示
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static object Success(string msg)
        {
            ResultDTO model = new ResultDTO();
            model.Code = 100;
            model.Msg = msg;
            model.States = "Success";
            return model;
        }
        /// <summary>
        /// 捕获异常提示
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static object Fail(string msg)
        {
            ResultDTO model = new ResultDTO();
            model.Code = 500;
            model.Msg = msg;
            model.States = "Fail";
            return model;
        }
        /// <summary>
        /// 操作错误提示
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static object Error(string msg)
        {
            ResultDTO model = new ResultDTO();
            model.Code = 400;
            model.Msg = msg;
            model.States = "Error";
            return model;
        }
        /// <summary>
        /// 警告提示
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static object Wrong(string msg)
        {
            ResultDTO model = new ResultDTO();
            model.Code = 200;
            model.Msg = msg;
            model.States = "Wrong";
            return model;
        }
    }
}
